<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 

<script>
$(function(){
	$("#commissionTypeSelectId").val("${viewRequest.params['_and_type_eq_number']}");
});

</script>
<form id="pagerForm" method="get" model="viewRequest" action="#rel#">
	<input type="hidden" name="viewRequest.page" value="${page.number}" />
	<input type="hidden" name="viewRequest.size" value="${page.size}" />
	<c:forEach items="${viewRequest.params}" var="params">
		<input type="hidden" id="${params.key}" name="viewRequest.params['${params.key}']" value="${params.value}" />
	</c:forEach>
	<c:forEach items="${viewRequest.sort}" var="sort">
		<input type="hidden" name="viewRequest.sort.${sort.key}" value="${sort.value}" />
	</c:forEach>
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="${rootUrl}/member/commission" method="get">
	<div class="searchBar">
		<ul class="searchContent">
			<li style="width: 250px">
				<label>会员名：</label>
				<input type="text" name="viewRequest.params['_and_m_dot_name_like']" value="${viewRequest.params['_and_m_dot_name_like']}"/>
			</li>
			<li style="width: 250px">
				<label>会员手机号：</label>
				<input type="text" name="viewRequest.params['_and_m_dot_mobile_like']" value="${viewRequest.params['_and_m_dot_mobile_like']}"/>
			</li>
			<li style="width: 300px">
				<label>分佣类别：</label>
				<select name="viewRequest.params['_and_type_eq_number']" id="commissionTypeSelectId">
					<option value="">全部</option>
					<option value="1">订单分佣</option>
					<option value="2">分销商升级</option>
					<option value="3">团队奖励</option>
					<option value="10">订单赠送积分</option>
					<option value="11">团体分佣积分</option>
					<option value="12">订单分佣积分</option>
					<option value="20">新会员注册上家分的积分</option>
				
				</select>
			</li >
			<li style="width: 250px">
				<label>订单编号：</label>
				<input type="text" name="viewRequest.params['_and_referCode_like']" value="${viewRequest.params['_and_referCode_like']}"/>
			</li>
			<li style="width: 500px">
				<label>分佣时间：</label>
				<input name="viewRequest.params['_and_createdAt_ge_date']" type="text" class="date" size="20" value="${viewRequest.params['_and_createdAt_ge_date'] }" placeholder="开始时间"/>
				<input name="viewRequest.params['_and_createdAt_le_date']" type="text" class="date" size="20" value="${viewRequest.params['_and_createdAt_le_date'] }" placeholder="结束时间"/>
			</li>
		</ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<table class="table" targetType="dialog"  width="100%" layoutH="110">
		<thead>
			<tr>
				<th width="50" align="center" >序号</th>
				<th width="100" align="center" >会员名</th>
				<th width="100" >会员手机号</th>
				<th width="100"  align="center" >分佣类型</th>
				<th width="50">分佣金额(元)</th>
				<th width="50">分佣比例(%)</th>
				<th width="100" align="center" >订单编号</th>
				<th width="100" align="center" >分佣时间</th>
				<th width="100" align="center" >分佣来源</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.content}" var="commission" varStatus="status">
				<td>${status.count}</td>
				<td>${commission.member.name}</td>
				<td>${commission.member.mobile}</td>
				<c:if test="${commission.type == 1}">
				<td>订单分佣</td>
				</c:if>
				<c:if test="${commission.type == 2}">
				<td>分销商升级</td>
				</c:if>
				<c:if test="${commission.type == 3}">
				<td>团队奖励</td>
				</c:if>
				<c:if test="${commission.type == 10}">
				<td>订单赠送积分</td>
				</c:if>
				<c:if test="${commission.type == 11}">
				<td>团体分佣积分</td>
				</c:if>
				<c:if test="${commission.type == 12}">
				<td>订单分佣积分</td>
				</c:if>
				<c:if test="${commission.type == 20}">
				<td>新会员注册上家分的积分</td>
				</c:if>
				
				<c:if test="${commission.type == 1 || commission.type == 2 || commission.type == 3}">
				<td class="listMoneyField"><fmt:formatNumber value="${commission.money/100}" pattern="0.00"/></td>
				</c:if>
				<c:if test="${commission.type == 10 || commission.type == 11 || commission.type == 12 || commission.type == 20}">
				<td class="listMoneyField">${commission.money} </td>
				</c:if>
				
				
				
				<td class="listMoneyField">${commission.rate}%</td>
				<td>${commission.referCode}</td>
				<td><fmt:formatDate value="${commission.createdAt}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
				<td>${commission.fromMember.loginname}</td>
				<td>
					暂无
				    <%-- <a title="查看" target="dialog" width="860" height="460" rel="notice_show" title="查看"  href="${rootUrl}/system/noticed/${notice.id}" >分佣详情</a> --%>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="${page.size}">${page.size}</option>
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select>
			<span>条，共${page.totalElements}条 </span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${page.totalElements}" numPerPage="${page.size}" pageNumShown="10" currentPage="${page.number}"></div>
	</div>
</div>